package com.project.storage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

@Mapper
public interface StorageMapper {

    @Update("update storage_tbl set count = count - #{count} where commodity_code = #{projectId}")
    int deduct(@Param("projectId") String projectId,@Param("count") Integer count);

    @Select("select count from storage_tbl where commodity_code = #{projectId} ")
    int getCount(@Param("projectId") String projectId);
}
